package com.worldcup.dao.question;

import com.worldcup.model.question.QuestionOption;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface QuestionOptionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(QuestionOption record);

    int insertSelective(QuestionOption record);

    QuestionOption selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(QuestionOption record);

    int updateByPrimaryKey(QuestionOption record);

    /**
     * 获取指定问题的所有选项
     * @param questionId
     * @return
     */
    List<QuestionOption> selectByQuestionId(long questionId);

    /**
     * 获取指定问题的指定选项
     * @param questionId
     * @param optionNo
     * @return
     */
    QuestionOption selectByQuestionIdAndAnswer(@Param("questionId") Long questionId, @Param("optionNo") String optionNo);
}